This invention relates to efficient execution of server side script code that generates dynamic web pages.
Server side scripting technology executes a user request received at a web server by dynamically generating web pages. Server side scripting allows easy implementation of interactive websites that interface with data stores for retrieving and storing information. Earlier server side scripting technology executed using Perl scripts or shell scripts and C programs using the Common Gateway Interface (CGI). The CGI technology used the operating system support for executing scripts. Recent technology based on PHP (Personal Home Page) scripting language allows embedding of script code with hypertext markup language (HTML). PHP scripts can be executed by the web server or extension modules of the web server. The direct execution by the web server improves performance compared to execution of the scripts by the operating system.
PHP scripts are easy to write since they are based on a small set of expressions and statements and are simple to learn. PUP allows the script to use untyped variables thereby providing ease of programming. However, PHP programs can cause high CPU consumption as well as high memory consumption. The process model of PHP programs is not scalable to large scale installations serving millions of clients, since a very large number of processes may be executed while executing a PHP script. Furthermore execution of PHP scripts is slow since the code is executed using a byte-code interpreter. The conventional PHP code uses weak typing, for example, a developer can use an array comprising elements of various types including integers, strings or arrays. Execution of a weakly typed code can be inefficient resulting in slow overall performance. Other slow operations used in PHP include dynamic symbol lookups for functions, variables, class methods, and constants. All these operations make a PHP program execution inefficient and slow.